package com.google.code.pomhelper.graph;

import java.util.ArrayList;
import java.util.List;

import org.apache.maven.model.Model;

public class ModulNode {
	private List<ModulNode> children;
	private ModulNode parent;
	private String artifactId;
	private String groupId;
	private Model model;
	private String pomPath;
	private String modulName;

	public ModulNode(ModulNode parent, String modulName) {
		this.parent = parent;
		this.modulName = modulName;

		children = new ArrayList<ModulNode>();
	}

	public ModulNode(ModulNode parent, String artifactId, String groupId, Model model, String pomPath) {
		this.parent = parent;
		this.artifactId = artifactId;
		this.groupId = groupId;
		this.model = model;
		this.pomPath = pomPath;

		children = new ArrayList<ModulNode>();
	}

	public String toNodeString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(groupId);
		buffer.append(":");
		buffer.append(artifactId);

		return buffer.toString();
	}

	/**
	 * @return the children
	 */
	public List<ModulNode> getChildren() {
		return children;
	}

	/**
	 * @param children
	 *            the children to set
	 */
	public void setChildren(List<ModulNode> children) {
		this.children = children;
	}

	/**
	 * @return the parent
	 */
	public ModulNode getParent() {
		return parent;
	}

	/**
	 * @return the artifactId
	 */
	public String getArtifactId() {
		return artifactId;
	}

	/**
	 * @return the groupId
	 */
	public String getGroupId() {
		return groupId;
	}

	/**
	 * @param parent
	 *            the parent to set
	 */
	public void setParent(ModulNode parent) {
		this.parent = parent;
	}

	/**
	 * @param artifactId
	 *            the artifactId to set
	 */
	public void setArtifactId(String artifactId) {
		this.artifactId = artifactId;
	}

	/**
	 * @param groupId
	 *            the groupId to set
	 */
	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	/**
	 * @return the model
	 */
	public Model getModel() {
		return model;
	}

	/**
	 * @param model
	 *            the model to set
	 */
	public void setModel(Model model) {
		this.model = model;
	}

	/**
	 * @return the pomPath
	 */
	public String getPomPath() {
		return pomPath;
	}

	/**
	 * @param pomPath
	 *            the pomPath to set
	 */
	public void setPomPath(String pomPath) {
		this.pomPath = pomPath;
	}

	/**
	 * @return the modulName
	 */
	public String getModulName() {
		return modulName;
	}

	/**
	 * @param modulName
	 *            the modulName to set
	 */
	public void setModulName(String modulName) {
		this.modulName = modulName;
	}
}
